package com.java_base.array_study;

public class ArrayDemo04 {
    public static void main(String[] args) {
        // 目标：数组的动态初始化
        double[] arr1 = new double[3];
        arr1[0] = 99.5;
        System.out.println(arr1[0]);
        System.out.println(arr1[1]);
        System.out.println(arr1[2]);

        String[] arr2 = new String[3];
        arr2[0] = "大岛优子";
        arr2[2] = "桥本环奈";
        System.out.println(arr2[0]);
        System.out.println(arr2[1]);
        System.out.println(arr2[2]);

        System.out.println("数组的静态初始化与动态初始化的区别："+"\n"+"1.当前已知存入的元素值，用静态初始化 "+"\n"+"2.当前还不知道要存入那些数据，用动态初始化");

    }
}
